package org.hcyspartnoc.luoxin.common.enums.chat;

import lombok.Getter;

@Getter
public enum ChatSenderTypeEnum {
    USER(1, "用户"),
    V_COUNSELOR(2, "虚拟咨询师");

    private final Integer code;
    private final String description;

    // 枚举的构造函数，默认是private的
    ChatSenderTypeEnum(Integer code, String description) {
        this.code = code;
        this.description = description;
    }

    // 可选：添加一个静态方法，根据code字符串获取对应的枚举实例
    public static ChatSenderTypeEnum fromCode(Integer code) {
        for (ChatSenderTypeEnum type : ChatSenderTypeEnum.values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return null;
    }
}
